package com.qiandw

import javax.annotation.Resource

import com.fasterxml.jackson.databind.ObjectMapper
import org.junit.Before
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
import org.springframework.test.context.web.WebAppConfiguration
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.setup.MockMvcBuilders
import org.springframework.web.context.WebApplicationContext

@SpringBootTest
@RunWith(classOf[SpringRunner])
@WebAppConfiguration
class SpringTestSuite {

  @Autowired
  var jsonMapping : ObjectMapper = _

  @Resource
  var webApplicationContext: WebApplicationContext = _

  var mvc: MockMvc = _

  @Before
  def init(): Unit = {
    mvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build()
  }

}
